package com.jinxin.platform.cdperprotypay.controller;

import com.jinxin.platform.base.common.pojo.JsonResult;
import com.jinxin.platform.cdperprotypay.pojo.domain.ChargeRoomDetail;
import com.jinxin.platform.cdperprotypay.pojo.form.ChargeRoomDetailForm;
import com.jinxin.platform.cdperprotypay.pojo.form.RoomDetailForm;
import com.jinxin.platform.cdperprotypay.service.ChargeRoomDetailService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author : zhangpeng
 * @date : 2020-06-29 17:52:58
 **/
@RestController
@RequestMapping("charge/roomDetail")
public class ChargeRoomDetailController {

    @Autowired
    private ChargeRoomDetailService chargeRoomDetailService;

    @PostMapping("/add")
    public JsonResult add(@RequestBody ChargeRoomDetailForm chargeRoomDetailForm){
        return chargeRoomDetailService.insert(chargeRoomDetailForm);
    }

    @PostMapping("/update")
    public JsonResult update(@RequestBody ChargeRoomDetail chargeRoomDetail){
        return chargeRoomDetailService.update(chargeRoomDetail);
    }

    @PostMapping("/del/{id}")
    public JsonResult del(@PathVariable("id") String id){
        return chargeRoomDetailService.deleteById(id);
    }

    @PostMapping("/pageList")
    public JsonResult pageList(@RequestBody RoomDetailForm roomDetailForm){
        return chargeRoomDetailService.pageList(roomDetailForm);
    }

    @PostMapping("/getOneRoom")
    public JsonResult getOneRoom(@RequestBody RoomDetailForm roomDetailForm){
        return chargeRoomDetailService.getOneRoom(roomDetailForm);
    }


}
